addAction

Add an action to this notification. Actions are typically displayed by the system as a button adjacent to the notification content. Action buttons won't appear on platforms prior to Android 4.1. Action buttons depend on expanded notifications, which are only available in Android 4.1 and later. To ensure that an action button's functionality is always available, first implement the functionality in the android.app.Activity that starts when a user clicks the notification (see setContentIntent()), and then enhance the notification by implementing the same functionality with addAction().

Parameters

icon

Resource ID of a drawable that represents the action.

title

Text describing the action.

intent

android.app.PendingIntent to be fired when the action is invoked.


Add an action to this notification. Actions are typically displayed by the system as a button adjacent to the notification content. Action buttons won't appear on platforms prior to Android 4.1. Action buttons depend on expanded notifications, which are only available in Android 4.1 and later. To ensure that an action button's functionality is always available, first implement the functionality in the android.app.Activity that starts when a user clicks the notification (see setContentIntent()), and then enhance the notification by implementing the same functionality with addAction().

Parameters

action

The action to add.